package com.itheima.bos.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.itheima.bos.bean.base.Standard;
import com.itheima.bos.dao.StandardDao;
import com.itheima.bos.service.StandardService;

@Service
@Transactional
public class StandardServiceImpl implements StandardService {

	@Autowired
	private StandardDao dao;

	@Override
	public void save(Standard standard) {
		dao.save(standard);
	}

	@Override
	public Page<Standard> findPageData(Pageable pageable) {
		return dao.findAll(pageable);
	}

	@Override
	public void delete(String[] idsArr) {
		for (String ids : idsArr) {
			Integer id = Integer.parseInt(ids);
			dao.delete(id);
		}

	}

	@Override
	public List<Standard> findAll() {
		return dao.findAll();
	}

}
